<?php
class Mupload_target extends CI_Model {

	function Mupload_target()
	{
		parent::__construct();
    	$this->setVars();
    }
        
	function setVars()
    {
    	$this->result = '';
        $this->idnya = 0;
	}

	function addtargetmanual($data){
		$dblokal = $this->load->database("default", TRUE);
		$data['created_by'] = $this->session->userdata('username');
		$dblokal->insert('t_trx_target_monthly',$data);
	}

	function getTerritory($region,$cluster)
	{
		$dblokal=$this->load->database("default",true);
		$query=$dblokal->query("SELECT * FROM f_get_cluster('$region', '$cluster')");
		return $query->row();
	}
}